<?php
    header("Content-Type:application/json");

	$conn = mysqli_connect('127.13.30.2','admin3R8pGpB','Vd8yi-7fciGM','wytweb');
	$sql="SET NAMES UTF8";
	mysqli_query($conn,$sql);
	
	$user_name=$_REQUEST['user_name'];
	$sex=$_REQUEST['sex'];
	$phone=$_REQUEST['phone'];
	$addr=$_REQUEST['addr'];
	$did=$_REQUEST['did'];
	$order_time=time()*1000;

	$sql="INSERT INTO kf_order(oid, phone,user_name,sex,order_time,addr,did) VALUES (null,'$phone','$user_name','$sex','$order_time','$addr','$did')";
	$result=mysqli_query($conn,$sql);
	
	if($result){
		echo '{"emg":"订单已成功提交！订单编号为：","ddh":'.mysqli_insert_id($conn).'}';
	}else{
		echo '{"emg":"订单提交失败！"'.$sql.'}';
	}
?>